function [output] = getDirection(dir)
%GETDIRECTION return the offset given a direction identifier

if (dir == 0)
output = [1 ; 0];

elseif (dir == 1)
output = [1 ; -1];

elseif (dir == 2)
output = [0 ; -1];

elseif (dir == 3)
output = [-1 ; -1];

elseif (dir == 4)
output = [-1 ; 0];

elseif (dir == 5)
output = [-1 ; 1];

elseif (dir == 6)
output = [0 ; 1];

else
output = [1 ; 1];

end

end